<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Reranker Framework (ReFr): reranker::PerceptronModel Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Reranker Framework (ReFr)
   
   </div>
   <div id="projectbrief">Reranking framework for structure prediction and discriminative language modeling</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="namespacereranker.html">reranker</a>      </li>
      <li class="navelem"><a class="el" href="classreranker_1_1_perceptron_model.html">PerceptronModel</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="#pro-static-attribs">Static Protected Attributes</a> &#124;
<a href="#friends">Friends</a>  </div>
  <div class="headertitle">
<div class="title">reranker::PerceptronModel Class Reference</div>  </div>
</div><!--header-->
<div class="contents">
<!-- doxytag: class="reranker::PerceptronModel" --><!-- doxytag: inherits="reranker::Model" -->
<p>This class implements a perceptron model reranker.  
 <a href="classreranker_1_1_perceptron_model.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="perceptron-model_8_h_source.html">perceptron-model.H</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for reranker::PerceptronModel:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classreranker_1_1_perceptron_model.png" usemap="#reranker::PerceptronModel_map" alt=""/>
  <map id="reranker::PerceptronModel_map" name="reranker::PerceptronModel_map">
<area href="classreranker_1_1_model.html" title="Model is an interface for reranking models." alt="reranker::Model" shape="rect" coords="0,56,185,80"/>
<area href="classreranker_1_1_factory_constructible.html" title="An interface to make it easier to implement Factory-constructible types by implementing both required..." alt="reranker::FactoryConstructible" shape="rect" coords="0,0,185,24"/>
<area href="classreranker_1_1_mira_style_model.html" title="A subclass of PerceptronModel that differs only in the way that the ComputeStepSize method is impleme..." alt="reranker::MiraStyleModel" shape="rect" coords="0,168,185,192"/>
</map>
 </div></div>

<p><a href="classreranker_1_1_perceptron_model-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_perceptron_model_1_1_default_update_predicate.html">DefaultUpdatePredicate</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The default update predicate for perceptron and perceptron-style models, which indicates to do a model update whenever the top-scoring candidate hypothesis under the current model differs from the oracle or &ldquo;gold&rdquo; candidate hypothesis.  <a href="classreranker_1_1_perceptron_model_1_1_default_update_predicate.html#details">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_perceptron_model_1_1_default_updater.html">DefaultUpdater</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The default update function for perceptron models.  <a href="classreranker_1_1_perceptron_model_1_1_default_updater.html#details">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_perceptron_model.html#a336a923d8970480c4d0448aa59690891">PerceptronModel</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a new instance with the empty string for its name and the <a class="el" href="classreranker_1_1_dot_product.html">DotProduct</a> kernel function.  <a href="#a336a923d8970480c4d0448aa59690891"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_perceptron_model.html#a8a67d3c789e5ec7966fedacf51e9d05b">PerceptronModel</a> (const string &amp;<a class="el" href="classreranker_1_1_model.html#a7360b45e4a024759cd393b376209cf3c">name</a>)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a new perceptron model with a <a class="el" href="classreranker_1_1_dot_product.html">DotProduct</a> kernel function.  <a href="#a8a67d3c789e5ec7966fedacf51e9d05b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_perceptron_model.html#a61ec640749f9704d06ba489d6c94fd01">PerceptronModel</a> (const string &amp;<a class="el" href="classreranker_1_1_model.html#a7360b45e4a024759cd393b376209cf3c">name</a>, <a class="el" href="classreranker_1_1_kernel_function.html">KernelFunction</a> *kernel_fn)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a new perceptron model with the specified kernel function.  <a href="#a61ec640749f9704d06ba489d6c94fd01"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_perceptron_model.html#ae5c2c4b2680e2be00fdf037e322e1a72">PerceptronModel</a> (const string &amp;<a class="el" href="classreranker_1_1_model.html#a7360b45e4a024759cd393b376209cf3c">name</a>, <a class="el" href="classreranker_1_1_kernel_function.html">KernelFunction</a> *kernel_fn, <a class="el" href="classreranker_1_1_symbols.html">Symbols</a> *<a class="el" href="classreranker_1_1_model.html#a736bec0b8f468285580982df181a7cd0">symbols</a>)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a new perceptron model with the specified kernel function and symbol table.  <a href="#ae5c2c4b2680e2be00fdf037e322e1a72"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_perceptron_model.html#a22ff6d5b2151e1f5111d65bdbb98590a">~PerceptronModel</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Destroys this perceptron model and all its data members.  <a href="#a22ff6d5b2151e1f5111d65bdbb98590a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual const string &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_perceptron_model.html#a80c863f01106f5721971324d8f23bc76">model_spec</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual const string &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_perceptron_model.html#ac91dd3431ca9a536b7e31db72d052207">proto_reader_spec</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual const string &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_perceptron_model.html#a11c4a5013286e6fd465c1dac494f3bcb">proto_writer_spec</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_perceptron_model.html#afae11bd9b41855ae74cf974fdf1ef417">best_model_epoch</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the epoch of the best models seen so far during training.  <a href="#afae11bd9b41855ae74cf974fdf1ef417"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_perceptron_model.html#aa2ce4f882d64528ae8e8daba60a54d3f">RegisterInitializers</a> (<a class="el" href="classreranker_1_1_initializers.html">Initializers</a> &amp;initializers)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Registers several variables that may be initialized when this object is constructed via <a class="el" href="classreranker_1_1_factory.html#a68117013334b03c94fc525e62080311f">Factory::CreateOrDie</a>.  <a href="#aa2ce4f882d64528ae8e8daba60a54d3f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_perceptron_model.html#ae2972c3b76402f2bafc6938984025090">Init</a> (const string &amp;arg)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes this instance.  <a href="#ae2972c3b76402f2bafc6938984025090"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_perceptron_model.html#a089a2268c88e89684c03d0730c5691c7">NeedToKeepTraining</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns whether more training epochs are required for this model.  <a href="#a089a2268c88e89684c03d0730c5691c7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_perceptron_model.html#a8ccab23af92f9a7db985257791f55acb">Train</a> (<a class="el" href="classreranker_1_1_candidate_set_iterator.html">CandidateSetIterator</a> &amp;examples, <a class="el" href="classreranker_1_1_candidate_set_iterator.html">CandidateSetIterator</a> &amp;development_test)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Trains this model on a collection of training examples, where each training example is a set of candidates.  <a href="#a8ccab23af92f9a7db985257791f55acb"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_perceptron_model.html#a598e88d61b4b35b2b5df59a00fc73d6e">NewEpoch</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_perceptron_model.html#a5e1359da40c7d987f2a14b7b47765a83">EndOfEpoch</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_perceptron_model.html#ae88557a6953807829c8d5fb760589487">TrainOneEpoch</a> (<a class="el" href="classreranker_1_1_candidate_set_iterator.html">CandidateSetIterator</a> &amp;examples)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Trains this model for one epoch, i.e., a single pass through the specified set of training examples.  <a href="#ae88557a6953807829c8d5fb760589487"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_perceptron_model.html#abfb9261016f61a8f660e699ccbdafa6a">TrainOnExample</a> (<a class="el" href="classreranker_1_1_candidate_set.html">CandidateSet</a> &amp;example)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Trains this model on the specified training example.  <a href="#abfb9261016f61a8f660e699ccbdafa6a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_perceptron_model.html#a2d1e5450a8d1ccc781b9b135b7504a3f">NeedToUpdate</a> (<a class="el" href="classreranker_1_1_candidate_set.html">CandidateSet</a> &amp;example)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Indicates whether the current model needs to be updated; the implementation here simply returns true if the best-scoring candidate is not equal to the gold or reference candidate.  <a href="#a2d1e5450a8d1ccc781b9b135b7504a3f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_perceptron_model.html#ae7e3982866cc3db145c0e3ff4b6ef783">Update</a> (<a class="el" href="classreranker_1_1_candidate_set.html">CandidateSet</a> &amp;example)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Updates the current model based on the specified set of candidates.  <a href="#ae7e3982866cc3db145c0e3ff4b6ef783"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_perceptron_model.html#a615950ed57b7ea2c729b374438f8d31e">Evaluate</a> (<a class="el" href="classreranker_1_1_candidate_set_iterator.html">CandidateSetIterator</a> &amp;development_test)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_perceptron_model.html#ace55bad139573080e682d5a269760673">ScoreCandidates</a> (<a class="el" href="classreranker_1_1_candidate_set.html">CandidateSet</a> &amp;candidates, bool training)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Scores the specified set of candidates according to either the raw or averaged version of this perceptron model, keeping track of which candidate has the highest score and which candidate has the lowest loss with the best score.  <a href="#ace55bad139573080e682d5a269760673"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_perceptron_model.html#aff26021ce19337a90068b66a219c0c6c">ScoreCandidate</a> (<a class="el" href="classreranker_1_1_candidate.html">Candidate</a> &amp;candidate, bool training)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Scores a candidate according to either the raw or averaged version of this perceptron model.  <a href="#aff26021ce19337a90068b66a219c0c6c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_perceptron_model.html#a919a86a6a3a52f62199b438fb092836d">CompactifyFeatureUids</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_perceptron_model.html#aad31b03949457cdabffdc4d2d9cefeaa">set_max_epochs_in_decline</a> (int max_epochs_in_decline)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the maximum number of training epochs to keep training after the model starts to degrade (i.e., has more errors than the best model so far).  <a href="#aad31b03949457cdabffdc4d2d9cefeaa"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual const <a class="el" href="classreranker_1_1_training_vector_set.html">TrainingVectorSet</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_perceptron_model.html#acc78df07e227da7761f05f75abba1144">models</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the set of models and statistics used by this <a class="el" href="classreranker_1_1_perceptron_model.html" title="This class implements a perceptron model reranker.">PerceptronModel</a> instance.  <a href="#acc78df07e227da7761f05f75abba1144"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_perceptron_model.html#aaed9bda6087a09387988a3def2c90279">SetDefaultObjects</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_perceptron_model.html#af7b4bb2f10d16bcc6bdf2428e6c09af3">ComputeFeaturesToUpdate</a> (const <a class="el" href="classreranker_1_1_candidate_set.html">CandidateSet</a> &amp;example, unordered_set&lt; int &gt; &amp;gold_features_to_update, unordered_set&lt; int &gt; &amp;best_scoring_features_to_update) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the features to be updated for the gold candidate and the best-scoring candidate.  <a href="#af7b4bb2f10d16bcc6bdf2428e6c09af3"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_perceptron_model.html#a64bdfab86dd1ea94c4918d409e2cd5d9">ComputeStepSize</a> (const unordered_set&lt; int &gt; &amp;gold_features, const unordered_set&lt; int &gt; &amp;best_scoring_features, const <a class="el" href="classreranker_1_1_candidate_set.html">CandidateSet</a> &amp;example)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the step size for the next update, and, as a side effect, caches this value in step_size_.  <a href="#a64bdfab86dd1ea94c4918d409e2cd5d9"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classreranker_1_1_training_vector_set.html">TrainingVectorSet</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_perceptron_model.html#a6f913688d02fe624d91d1416c71e157c">models_</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The feature vectors representing this model.  <a href="#a6f913688d02fe624d91d1416c71e157c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classreranker_1_1_training_vector_set.html">TrainingVectorSet</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_perceptron_model.html#a234283287d5a7f59fd8a1d1cf767fbc1">best_models_</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The best models seen so far during training, according to evaluation on the held-out development test data.  <a href="#a234283287d5a7f59fd8a1d1cf767fbc1"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_perceptron_model.html#acc08b37db0b4b7ea4cd8d340a4e86216">best_model_epoch_</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The epoch of the best models seen so far during training.  <a href="#acc08b37db0b4b7ea4cd8d340a4e86216"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_perceptron_model.html#ad2d89585eec1b54986043d6f29a516c3">max_epochs_in_decline_</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The maximum number of training epochs to keep training after the model starts to degrade (i.e., has more errors than the best model so far).  <a href="#ad2d89585eec1b54986043d6f29a516c3"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_perceptron_model.html#a0c25e67c7e7e5cef36bbc1b1fb1cd111">num_epochs_in_decline_</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The current number of training epochs in which the model has been degrading in development set performance (i.e., has been having more errors than best model so far).  <a href="#a0c25e67c7e7e5cef36bbc1b1fb1cd111"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_perceptron_model.html#af852ec770ce5135acbf6f5db34b9d4fc">step_size_</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The last value computed by the ComputeStepSize method.  <a href="#af852ec770ce5135acbf6f5db34b9d4fc"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_perceptron_model.html#ae18957d720914dd4bd4528f3de5b282d">model_spec_</a></td></tr>
<tr><td colspan="2"><h2><a name="pro-static-attribs"></a>
Static Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_perceptron_model.html#a78beef8fe9344050187f176230f52a0b">proto_reader_spec_</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">A string that specifies to construct a <a class="el" href="classreranker_1_1_perceptron_model_proto_reader.html">PerceptronModelProtoReader</a>, which is capable of de-serializing an instance of this class.  <a href="#a78beef8fe9344050187f176230f52a0b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_perceptron_model.html#a2fcf5e3e8dbb2c0f731509d1af9230c0">proto_writer_spec_</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">A string that specifies to construct a <a class="el" href="classreranker_1_1_perceptron_model_proto_writer.html">PerceptronModelProtoWriter</a>, which is capable of serializing an instance of this class.  <a href="#a2fcf5e3e8dbb2c0f731509d1af9230c0"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="friends"></a>
Friends</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_perceptron_model.html#afb6ec9e4be1c64e078cadea26f2a3b8b">PerceptronModelProtoWriter</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_perceptron_model.html#af5282652b1f0ee34453543af00f8cee1">PerceptronModelProtoReader</a></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>This class implements a perceptron model reranker. </p>
<p>While this model can consist of arbitrary feature types, there is special handling for n-gram&ndash;based features, to capture the fact that, e.g., a bigram suffix exists whenever a trigram occurs. </p>

<p>Definition at line <a class="el" href="perceptron-model_8_h_source.html#l00063">63</a> of file <a class="el" href="perceptron-model_8_h_source.html">perceptron-model.H</a>.</p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a336a923d8970480c4d0448aa59690891"></a><!-- doxytag: member="reranker::PerceptronModel::PerceptronModel" ref="a336a923d8970480c4d0448aa59690891" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classreranker_1_1_perceptron_model.html#a336a923d8970480c4d0448aa59690891">reranker::PerceptronModel::PerceptronModel</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Constructs a new instance with the empty string for its name and the <a class="el" href="classreranker_1_1_dot_product.html">DotProduct</a> kernel function. </p>

<p>Definition at line <a class="el" href="perceptron-model_8_h_source.html#l00070">70</a> of file <a class="el" href="perceptron-model_8_h_source.html">perceptron-model.H</a>.</p>

</div>
</div>
<a class="anchor" id="a8a67d3c789e5ec7966fedacf51e9d05b"></a><!-- doxytag: member="reranker::PerceptronModel::PerceptronModel" ref="a8a67d3c789e5ec7966fedacf51e9d05b" args="(const string &amp;name)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classreranker_1_1_perceptron_model.html#a336a923d8970480c4d0448aa59690891">reranker::PerceptronModel::PerceptronModel</a> </td>
          <td>(</td>
          <td class="paramtype">const string &amp;&#160;</td>
          <td class="paramname"><em>name</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Constructs a new perceptron model with a <a class="el" href="classreranker_1_1_dot_product.html">DotProduct</a> kernel function. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>the unique name of this perceptron model instance </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="perceptron-model_8_h_source.html#l00085">85</a> of file <a class="el" href="perceptron-model_8_h_source.html">perceptron-model.H</a>.</p>

</div>
</div>
<a class="anchor" id="a61ec640749f9704d06ba489d6c94fd01"></a><!-- doxytag: member="reranker::PerceptronModel::PerceptronModel" ref="a61ec640749f9704d06ba489d6c94fd01" args="(const string &amp;name, KernelFunction *kernel_fn)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classreranker_1_1_perceptron_model.html#a336a923d8970480c4d0448aa59690891">reranker::PerceptronModel::PerceptronModel</a> </td>
          <td>(</td>
          <td class="paramtype">const string &amp;&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classreranker_1_1_kernel_function.html">KernelFunction</a> *&#160;</td>
          <td class="paramname"><em>kernel_fn</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Constructs a new perceptron model with the specified kernel function. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>the unique name of this perceptron model instance </td></tr>
    <tr><td class="paramname">kernel_fn</td><td>the kernel function for this model to use when evaluating on training or test instances </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="perceptron-model_8_h_source.html#l00101">101</a> of file <a class="el" href="perceptron-model_8_h_source.html">perceptron-model.H</a>.</p>

</div>
</div>
<a class="anchor" id="ae5c2c4b2680e2be00fdf037e322e1a72"></a><!-- doxytag: member="reranker::PerceptronModel::PerceptronModel" ref="ae5c2c4b2680e2be00fdf037e322e1a72" args="(const string &amp;name, KernelFunction *kernel_fn, Symbols *symbols)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classreranker_1_1_perceptron_model.html#a336a923d8970480c4d0448aa59690891">reranker::PerceptronModel::PerceptronModel</a> </td>
          <td>(</td>
          <td class="paramtype">const string &amp;&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classreranker_1_1_kernel_function.html">KernelFunction</a> *&#160;</td>
          <td class="paramname"><em>kernel_fn</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classreranker_1_1_symbols.html">Symbols</a> *&#160;</td>
          <td class="paramname"><em>symbols</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Constructs a new perceptron model with the specified kernel function and symbol table. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>the unique name of this model instance </td></tr>
    <tr><td class="paramname">kernel_fn</td><td>the kernel function for this model to use when applied to training or test instances </td></tr>
    <tr><td class="paramname">symbols</td><td>the symbol table for this <a class="el" href="classreranker_1_1_model.html" title="Model is an interface for reranking models.">Model</a> to use; this <a class="el" href="classreranker_1_1_model.html" title="Model is an interface for reranking models.">Model</a> will be responsible for deleting this <a class="el" href="classreranker_1_1_symbols.html" title="An interface specifying a converter from symbols (strings) to int indices.">Symbols</a> object </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="perceptron-model_8_h_source.html#l00120">120</a> of file <a class="el" href="perceptron-model_8_h_source.html">perceptron-model.H</a>.</p>

</div>
</div>
<a class="anchor" id="a22ff6d5b2151e1f5111d65bdbb98590a"></a><!-- doxytag: member="reranker::PerceptronModel::~PerceptronModel" ref="a22ff6d5b2151e1f5111d65bdbb98590a" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="classreranker_1_1_perceptron_model.html#a22ff6d5b2151e1f5111d65bdbb98590a">reranker::PerceptronModel::~PerceptronModel</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Destroys this perceptron model and all its data members. </p>

<p>Definition at line <a class="el" href="perceptron-model_8_h_source.html#l00134">134</a> of file <a class="el" href="perceptron-model_8_h_source.html">perceptron-model.H</a>.</p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="afae11bd9b41855ae74cf974fdf1ef417"></a><!-- doxytag: member="reranker::PerceptronModel::best_model_epoch" ref="afae11bd9b41855ae74cf974fdf1ef417" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual int <a class="el" href="classreranker_1_1_perceptron_model.html#afae11bd9b41855ae74cf974fdf1ef417">reranker::PerceptronModel::best_model_epoch</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns the epoch of the best models seen so far during training. </p>
<p>(Primarily here for the <a class="el" href="classreranker_1_1_perceptron_model_proto_writer.html" title="A class to construct a ModelMessage from a PerceptronModel instance.">PerceptronModelProtoWriter</a> serializer.) </p>

<p>Implements <a class="el" href="classreranker_1_1_model.html#a02b18d754bc85251690f9ffe09c0a86e">reranker::Model</a>.</p>

<p>Definition at line <a class="el" href="perceptron-model_8_h_source.html#l00190">190</a> of file <a class="el" href="perceptron-model_8_h_source.html">perceptron-model.H</a>.</p>

</div>
</div>
<a class="anchor" id="a919a86a6a3a52f62199b438fb092836d"></a><!-- doxytag: member="reranker::PerceptronModel::CompactifyFeatureUids" ref="a919a86a6a3a52f62199b438fb092836d" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classreranker_1_1_perceptron_model.html#a919a86a6a3a52f62199b438fb092836d">reranker::PerceptronModel::CompactifyFeatureUids</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Renumbers the potentially sparse feature uid&rsquo;s so that they occupy the interval <code>[0,n-1]</code> densely, for <code>n</code> non-zero features in use by this model. </p>
<p>If the internal <a class="el" href="classreranker_1_1_symbols.html" title="An interface specifying a converter from symbols (strings) to int indices.">Symbols</a> instance is non-<code>NULL</code>, then this method also adjusts it to reflect the new set of feature uid&rsquo;s. </p>
 
<p>Implements <a class="el" href="classreranker_1_1_model.html#aabd4a60963fac4b9b06f510a55b1dfd7">reranker::Model</a>.</p>

<p>Definition at line <a class="el" href="perceptron-model_8_c_source.html#l00370">370</a> of file <a class="el" href="perceptron-model_8_c_source.html">perceptron-model.C</a>.</p>

</div>
</div>
<a class="anchor" id="af7b4bb2f10d16bcc6bdf2428e6c09af3"></a><!-- doxytag: member="reranker::PerceptronModel::ComputeFeaturesToUpdate" ref="af7b4bb2f10d16bcc6bdf2428e6c09af3" args="(const CandidateSet &amp;example, unordered_set&lt; int &gt; &amp;gold_features_to_update, unordered_set&lt; int &gt; &amp;best_scoring_features_to_update) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classreranker_1_1_perceptron_model.html#af7b4bb2f10d16bcc6bdf2428e6c09af3">reranker::PerceptronModel::ComputeFeaturesToUpdate</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classreranker_1_1_candidate_set.html">CandidateSet</a> &amp;&#160;</td>
          <td class="paramname"><em>example</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unordered_set&lt; int &gt; &amp;&#160;</td>
          <td class="paramname"><em>gold_features_to_update</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unordered_set&lt; int &gt; &amp;&#160;</td>
          <td class="paramname"><em>best_scoring_features_to_update</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const<code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Computes the features to be updated for the gold candidate and the best-scoring candidate. </p>
<p>Let G be gold features and B be best-scoring features. For the perceptron, we want to update the set difference G\B positively and B\G negatively. These two set difference operations are computed by this method. </p>
<dl class="attention"><dt><b>Attention:</b></dt><dd>Neither of the two specified sets are cleared by this method.</dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir"></td><td class="paramname">example</td><td>the candidate set from which to get the gold feature vector and the best-scoring candidate feature vector </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">gold_features_to_update</td><td>a set in which to insert the uid's of all features in the gold that are not in the best scoring candidate </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">best_scoring_features_to_update</td><td>a set in which to insert the uid's of all features in the best-scoring candidate that are not in the gold candidate </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="perceptron-model_8_c_source.html#l00405">405</a> of file <a class="el" href="perceptron-model_8_c_source.html">perceptron-model.C</a>.</p>

</div>
</div>
<a class="anchor" id="a64bdfab86dd1ea94c4918d409e2cd5d9"></a><!-- doxytag: member="reranker::PerceptronModel::ComputeStepSize" ref="a64bdfab86dd1ea94c4918d409e2cd5d9" args="(const unordered_set&lt; int &gt; &amp;gold_features, const unordered_set&lt; int &gt; &amp;best_scoring_features, const CandidateSet &amp;example)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual double <a class="el" href="classreranker_1_1_perceptron_model.html#a64bdfab86dd1ea94c4918d409e2cd5d9">reranker::PerceptronModel::ComputeStepSize</a> </td>
          <td>(</td>
          <td class="paramtype">const unordered_set&lt; int &gt; &amp;&#160;</td>
          <td class="paramname"><em>gold_features</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unordered_set&lt; int &gt; &amp;&#160;</td>
          <td class="paramname"><em>best_scoring_features</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classreranker_1_1_candidate_set.html">CandidateSet</a> &amp;&#160;</td>
          <td class="paramname"><em>example</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline, protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Computes the step size for the next update, and, as a side effect, caches this value in step_size_. </p>
<p>In the case of the standard perceptron model implemented here, the step size does not change, and so this method simply returns the step size value set at construction time. </p>

<p>Reimplemented in <a class="el" href="classreranker_1_1_mira_style_model.html#acb71e90c7cc465436fc4f9a4d7ec7d0d">reranker::MiraStyleModel</a>.</p>

<p>Definition at line <a class="el" href="perceptron-model_8_h_source.html#l00389">389</a> of file <a class="el" href="perceptron-model_8_h_source.html">perceptron-model.H</a>.</p>

</div>
</div>
<a class="anchor" id="a5e1359da40c7d987f2a14b7b47765a83"></a><!-- doxytag: member="reranker::PerceptronModel::EndOfEpoch" ref="a5e1359da40c7d987f2a14b7b47765a83" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classreranker_1_1_perceptron_model.html#a5e1359da40c7d987f2a14b7b47765a83">reranker::PerceptronModel::EndOfEpoch</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Implements <a class="el" href="classreranker_1_1_model.html#a0392df23892406abcbf21bbe1bf5392a">reranker::Model</a>.</p>

<p>Definition at line <a class="el" href="perceptron-model_8_c_source.html#l00185">185</a> of file <a class="el" href="perceptron-model_8_c_source.html">perceptron-model.C</a>.</p>

</div>
</div>
<a class="anchor" id="a615950ed57b7ea2c729b374438f8d31e"></a><!-- doxytag: member="reranker::PerceptronModel::Evaluate" ref="a615950ed57b7ea2c729b374438f8d31e" args="(CandidateSetIterator &amp;development_test)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double <a class="el" href="classreranker_1_1_perceptron_model.html#a615950ed57b7ea2c729b374438f8d31e">reranker::PerceptronModel::Evaluate</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classreranker_1_1_candidate_set_iterator.html">CandidateSetIterator</a> &amp;&#160;</td>
          <td class="paramname"><em>development_test</em></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Evaluates this model on the specified set of held-out development test data. </p>
<dl class="user"><dt><b>Side effects:</b></dt><dd>This method is guaranteed to append a value to the internal <a class="el" href="classreranker_1_1_model.html#ad3a296860f768bee866213cc0c8bbf83">loss_per_epoch_</a> vector.</dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">development_test</td><td>a held-out set of examples to use for evaluation of this model (during training, this method is typically invoked after each epoch to determine when to stop) </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the loss of this model when evaluated on the specified development test set </dd></dl>
 
<p>Implements <a class="el" href="classreranker_1_1_model.html#aaa962ac773eb3b4483452c846eda0f44">reranker::Model</a>.</p>

<p>Definition at line <a class="el" href="perceptron-model_8_c_source.html#l00288">288</a> of file <a class="el" href="perceptron-model_8_c_source.html">perceptron-model.C</a>.</p>

</div>
</div>
<a class="anchor" id="ae2972c3b76402f2bafc6938984025090"></a><!-- doxytag: member="reranker::PerceptronModel::Init" ref="ae2972c3b76402f2bafc6938984025090" args="(const string &amp;arg)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classreranker_1_1_perceptron_model.html#ae2972c3b76402f2bafc6938984025090">reranker::PerceptronModel::Init</a> </td>
          <td>(</td>
          <td class="paramtype">const string &amp;&#160;</td>
          <td class="paramname"><em>arg</em></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Initializes this instance. </p>
<p>This method is guaranteed to be invoked by a <a class="el" href="classreranker_1_1_factory.html">Factory</a> just after construction. </p>

<p>Reimplemented from <a class="el" href="classreranker_1_1_factory_constructible.html#a0da3c3a5ce59818137e59a9364162101">reranker::FactoryConstructible</a>.</p>

<p>Definition at line <a class="el" href="perceptron-model_8_c_source.html#l00082">82</a> of file <a class="el" href="perceptron-model_8_c_source.html">perceptron-model.C</a>.</p>

</div>
</div>
<a class="anchor" id="a80c863f01106f5721971324d8f23bc76"></a><!-- doxytag: member="reranker::PerceptronModel::model_spec" ref="a80c863f01106f5721971324d8f23bc76" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual const string&amp; <a class="el" href="classreranker_1_1_perceptron_model.html#a80c863f01106f5721971324d8f23bc76">reranker::PerceptronModel::model_spec</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the spec string for constructing a default instance of this model so it may be properly de-serialized by its <a class="el" href="classreranker_1_1_model_proto_reader.html">ModelProtoReader</a>. </p>
 
<p>Implements <a class="el" href="classreranker_1_1_model.html#a0e4935d14bb956cd7ab722e39790c9b7">reranker::Model</a>.</p>

<p>Definition at line <a class="el" href="perceptron-model_8_h_source.html#l00176">176</a> of file <a class="el" href="perceptron-model_8_h_source.html">perceptron-model.H</a>.</p>

</div>
</div>
<a class="anchor" id="acc78df07e227da7761f05f75abba1144"></a><!-- doxytag: member="reranker::PerceptronModel::models" ref="acc78df07e227da7761f05f75abba1144" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual const <a class="el" href="classreranker_1_1_training_vector_set.html">TrainingVectorSet</a>&amp; <a class="el" href="classreranker_1_1_perceptron_model.html#acc78df07e227da7761f05f75abba1144">reranker::PerceptronModel::models</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns the set of models and statistics used by this <a class="el" href="classreranker_1_1_perceptron_model.html" title="This class implements a perceptron model reranker.">PerceptronModel</a> instance. </p>

<p>Definition at line <a class="el" href="perceptron-model_8_h_source.html#l00353">353</a> of file <a class="el" href="perceptron-model_8_h_source.html">perceptron-model.H</a>.</p>

</div>
</div>
<a class="anchor" id="a089a2268c88e89684c03d0730c5691c7"></a><!-- doxytag: member="reranker::PerceptronModel::NeedToKeepTraining" ref="a089a2268c88e89684c03d0730c5691c7" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="classreranker_1_1_perceptron_model.html#a089a2268c88e89684c03d0730c5691c7">reranker::PerceptronModel::NeedToKeepTraining</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns whether more training epochs are required for this model. </p>
<dl class="user"><dt><b>Implementation advice:</b></dt><dd>Implementations of the <a class="el" href="classreranker_1_1_perceptron_model.html#a8ccab23af92f9a7db985257791f55acb">Train</a> method are strongly encouraged to have their main loop test be the return value of this method. Also, the return value of this method should respect the <a class="el" href="classreranker_1_1_model.html#ae376fddf5518ab1e7a9f5b5d114afe7b">min_epochs</a> and <a class="el" href="classreranker_1_1_model.html#a02cba71a3c90cec312f0244c39ed30a5">max_epochs</a> values. </dd></dl>

<p>Implements <a class="el" href="classreranker_1_1_model.html#a878991ef6241e976d565ac167dd3a157">reranker::Model</a>.</p>

<p>Definition at line <a class="el" href="perceptron-model_8_c_source.html#l00115">115</a> of file <a class="el" href="perceptron-model_8_c_source.html">perceptron-model.C</a>.</p>

</div>
</div>
<a class="anchor" id="a2d1e5450a8d1ccc781b9b135b7504a3f"></a><!-- doxytag: member="reranker::PerceptronModel::NeedToUpdate" ref="a2d1e5450a8d1ccc781b9b135b7504a3f" args="(CandidateSet &amp;example)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="classreranker_1_1_perceptron_model.html#a2d1e5450a8d1ccc781b9b135b7504a3f">reranker::PerceptronModel::NeedToUpdate</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classreranker_1_1_candidate_set.html">CandidateSet</a> &amp;&#160;</td>
          <td class="paramname"><em>example</em></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Indicates whether the current model needs to be updated; the implementation here simply returns true if the best-scoring candidate is not equal to the gold or reference candidate. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">example</td><td>the current training example </td></tr>
  </table>
  </dd>
</dl>

<p>Implements <a class="el" href="classreranker_1_1_model.html#a2fff2752a2ec18289f26954daf526cb3">reranker::Model</a>.</p>

<p>Definition at line <a class="el" href="perceptron-model_8_c_source.html#l00226">226</a> of file <a class="el" href="perceptron-model_8_c_source.html">perceptron-model.C</a>.</p>

</div>
</div>
<a class="anchor" id="a598e88d61b4b35b2b5df59a00fc73d6e"></a><!-- doxytag: member="reranker::PerceptronModel::NewEpoch" ref="a598e88d61b4b35b2b5df59a00fc73d6e" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classreranker_1_1_perceptron_model.html#a598e88d61b4b35b2b5df59a00fc73d6e">reranker::PerceptronModel::NewEpoch</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Implements <a class="el" href="classreranker_1_1_model.html#a4c962a69b553f71c58a60aa6d86e7577">reranker::Model</a>.</p>

<p>Definition at line <a class="el" href="perceptron-model_8_c_source.html#l00163">163</a> of file <a class="el" href="perceptron-model_8_c_source.html">perceptron-model.C</a>.</p>

</div>
</div>
<a class="anchor" id="ac91dd3431ca9a536b7e31db72d052207"></a><!-- doxytag: member="reranker::PerceptronModel::proto_reader_spec" ref="ac91dd3431ca9a536b7e31db72d052207" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual const string&amp; <a class="el" href="classreranker_1_1_perceptron_model.html#ac91dd3431ca9a536b7e31db72d052207">reranker::PerceptronModel::proto_reader_spec</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the spec string for contructing an instance of a <a class="el" href="classreranker_1_1_model_proto_reader.html">ModelProtoReader</a> capable of de-serializing this <a class="el" href="classreranker_1_1_model.html">Model</a> implementation. </p>
 
<p>Implements <a class="el" href="classreranker_1_1_model.html#a0fc70a87fe28a300cac5fd1af552e27f">reranker::Model</a>.</p>

<p>Definition at line <a class="el" href="perceptron-model_8_h_source.html#l00179">179</a> of file <a class="el" href="perceptron-model_8_h_source.html">perceptron-model.H</a>.</p>

</div>
</div>
<a class="anchor" id="a11c4a5013286e6fd465c1dac494f3bcb"></a><!-- doxytag: member="reranker::PerceptronModel::proto_writer_spec" ref="a11c4a5013286e6fd465c1dac494f3bcb" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual const string&amp; <a class="el" href="classreranker_1_1_perceptron_model.html#a11c4a5013286e6fd465c1dac494f3bcb">reranker::PerceptronModel::proto_writer_spec</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the spec string for contructing an instance of a <a class="el" href="classreranker_1_1_model_proto_writer.html">ModelProtoWriter</a> capable of serializing this <a class="el" href="classreranker_1_1_model.html">Model</a> implementation. </p>
 
<p>Implements <a class="el" href="classreranker_1_1_model.html#ac94d349353f82e74567ec9b56dbbdcdd">reranker::Model</a>.</p>

<p>Definition at line <a class="el" href="perceptron-model_8_h_source.html#l00184">184</a> of file <a class="el" href="perceptron-model_8_h_source.html">perceptron-model.H</a>.</p>

</div>
</div>
<a class="anchor" id="aa2ce4f882d64528ae8e8daba60a54d3f"></a><!-- doxytag: member="reranker::PerceptronModel::RegisterInitializers" ref="aa2ce4f882d64528ae8e8daba60a54d3f" args="(Initializers &amp;initializers)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classreranker_1_1_perceptron_model.html#aa2ce4f882d64528ae8e8daba60a54d3f">reranker::PerceptronModel::RegisterInitializers</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classreranker_1_1_initializers.html">Initializers</a> &amp;&#160;</td>
          <td class="paramname"><em>initializers</em></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Registers several variables that may be initialized when this object is constructed via <a class="el" href="classreranker_1_1_factory.html#a68117013334b03c94fc525e62080311f">Factory::CreateOrDie</a>. </p>
<table class="doxtable">
<tr>
<th>Variable name </th><th>Type </th><th>Required </th><th>Description </th><th>Default value  </th></tr>
<tr>
<td><code>name</code> </td><td><code>string</code> </td><td>Yes </td><td>The name of this model instance (for human consumption). </td><td>n/a  </td></tr>
<tr>
<td><code>score_comparator</code> </td><td><a class="el" href="classreranker_1_1_candidate_1_1_comparator.html">Candidate::Comparator</a> </td><td>No </td><td>The object by which the scores of two <a class="el" href="classreranker_1_1_candidate.html">Candidate</a> instances are compared. </td><td><a class="el" href="classreranker_1_1_default_score_comparator.html">DefaultScoreComparator</a>  </td></tr>
<tr>
<td><code>gold_comparator</code> </td><td><a class="el" href="classreranker_1_1_candidate_1_1_comparator.html">Candidate::Comparator</a> </td><td>No </td><td>The object by which two <a class="el" href="classreranker_1_1_candidate.html">Candidate</a> instances are compared when finding the &ldquo;gold&rdquo; candidate. </td><td><a class="el" href="classreranker_1_1_default_gold_comparator.html">DefaultGoldComparator</a>  </td></tr>
<tr>
<td><code>candidate_set_scorer</code> </td><td><a class="el" href="classreranker_1_1_candidate_set_1_1_scorer.html">CandidateSet::Scorer</a> </td><td>No </td><td>The object to score a <a class="el" href="classreranker_1_1_candidate_set.html">CandidateSet</a> instance. </td><td><a class="el" href="classreranker_1_1_default_candidate_set_scorer.html">DefaultCandidateSetScorer</a>  </td></tr>
<tr>
<td><code>update_predicate</code> </td><td><a class="el" href="classreranker_1_1_model_1_1_update_predicate.html">Model::UpdatePredicate</a> </td><td>No </td><td>The object to let the model know if it is time to do an update. </td><td><a class="el" href="classreranker_1_1_perceptron_model_1_1_default_update_predicate.html">PerceptronModelDefaultUpdatePredicate </a>  </td></tr>
<tr>
<td><code>updater</code> </td><td><a class="el" href="classreranker_1_1_model_1_1_updater.html">Model::Updater</a> </td><td>No </td><td>The object to update the model. </td><td><a class="el" href="classreranker_1_1_perceptron_model_1_1_default_updater.html">PerceptronModelDefaultUpdater </a>  </td></tr>
<tr>
<td><code>step_size</code> </td><td>double </td><td>No </td><td>The initial value of the step size for parameter updates. </td><td><code>1.0</code>  </td></tr>
</table>

<p>Reimplemented from <a class="el" href="classreranker_1_1_factory_constructible.html#a4a45cf0a7822b3cd26ec882f0330b788">reranker::FactoryConstructible</a>.</p>

<p>Reimplemented in <a class="el" href="classreranker_1_1_mira_style_model.html#a9a1d3a3402248cb41e99ed4226732192">reranker::MiraStyleModel</a>.</p>

<p>Definition at line <a class="el" href="perceptron-model_8_c_source.html#l00070">70</a> of file <a class="el" href="perceptron-model_8_c_source.html">perceptron-model.C</a>.</p>

</div>
</div>
<a class="anchor" id="aff26021ce19337a90068b66a219c0c6c"></a><!-- doxytag: member="reranker::PerceptronModel::ScoreCandidate" ref="aff26021ce19337a90068b66a219c0c6c" args="(Candidate &amp;candidate, bool training)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double <a class="el" href="classreranker_1_1_perceptron_model.html#aff26021ce19337a90068b66a219c0c6c">reranker::PerceptronModel::ScoreCandidate</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classreranker_1_1_candidate.html">Candidate</a> &amp;&#160;</td>
          <td class="paramname"><em>candidate</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>training</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Scores a candidate according to either the raw or averaged version of this perceptron model. </p>
<p>The specified candidate's score may be modified.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">candidate</td><td>the candidate to be scored by this model </td></tr>
    <tr><td class="paramdir"></td><td class="paramname">training</td><td>whether this is being called during training or evaluation of a model </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the score of the specified candidate according to the specified model (also contained in the candidate itself) </dd></dl>

<p>Implements <a class="el" href="classreranker_1_1_model.html#a5c8423bb022156759515b808f93751a9">reranker::Model</a>.</p>

<p>Definition at line <a class="el" href="perceptron-model_8_c_source.html#l00355">355</a> of file <a class="el" href="perceptron-model_8_c_source.html">perceptron-model.C</a>.</p>

</div>
</div>
<a class="anchor" id="ace55bad139573080e682d5a269760673"></a><!-- doxytag: member="reranker::PerceptronModel::ScoreCandidates" ref="ace55bad139573080e682d5a269760673" args="(CandidateSet &amp;candidates, bool training)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classreranker_1_1_perceptron_model.html#ace55bad139573080e682d5a269760673">reranker::PerceptronModel::ScoreCandidates</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classreranker_1_1_candidate_set.html">CandidateSet</a> &amp;&#160;</td>
          <td class="paramname"><em>candidates</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>training</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Scores the specified set of candidates according to either the raw or averaged version of this perceptron model, keeping track of which candidate has the highest score and which candidate has the lowest loss with the best score. </p>
<p>The scores of the specified set of candidates may be modified. This method is currently entirely implemented via <a class="el" href="classreranker_1_1_default_candidate_set_scorer.html">DefaultCandidateSetScorer</a>.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">candidates</td><td>the set of candidates to be scored </td></tr>
    <tr><td class="paramdir"></td><td class="paramname">training</td><td>whether this is being called during training or evaluation of a model</td></tr>
  </table>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classreranker_1_1_default_candidate_set_scorer.html#a1d6db4a2392e098c8afbef0e55b23fe1">DefaultCandidateSetScorer::Score</a> </dd></dl>

<p>Implements <a class="el" href="classreranker_1_1_model.html#ad8510757242f405b549473b5ce6f8911">reranker::Model</a>.</p>

<p>Definition at line <a class="el" href="perceptron-model_8_c_source.html#l00350">350</a> of file <a class="el" href="perceptron-model_8_c_source.html">perceptron-model.C</a>.</p>

</div>
</div>
<a class="anchor" id="aad31b03949457cdabffdc4d2d9cefeaa"></a><!-- doxytag: member="reranker::PerceptronModel::set_max_epochs_in_decline" ref="aad31b03949457cdabffdc4d2d9cefeaa" args="(int max_epochs_in_decline)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classreranker_1_1_perceptron_model.html#aad31b03949457cdabffdc4d2d9cefeaa">reranker::PerceptronModel::set_max_epochs_in_decline</a> </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>max_epochs_in_decline</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Sets the maximum number of training epochs to keep training after the model starts to degrade (i.e., has more errors than the best model so far). </p>

<p>Definition at line <a class="el" href="perceptron-model_8_h_source.html#l00347">347</a> of file <a class="el" href="perceptron-model_8_h_source.html">perceptron-model.H</a>.</p>

</div>
</div>
<a class="anchor" id="aaed9bda6087a09387988a3def2c90279"></a><!-- doxytag: member="reranker::PerceptronModel::SetDefaultObjects" ref="aaed9bda6087a09387988a3def2c90279" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classreranker_1_1_perceptron_model.html#aaed9bda6087a09387988a3def2c90279">reranker::PerceptronModel::SetDefaultObjects</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline, protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Reimplemented from <a class="el" href="classreranker_1_1_model.html#a5ae78a37db26302ce041552de0032b6e">reranker::Model</a>.</p>

<p>Definition at line <a class="el" href="perceptron-model_8_h_source.html#l00356">356</a> of file <a class="el" href="perceptron-model_8_h_source.html">perceptron-model.H</a>.</p>

</div>
</div>
<a class="anchor" id="a8ccab23af92f9a7db985257791f55acb"></a><!-- doxytag: member="reranker::PerceptronModel::Train" ref="a8ccab23af92f9a7db985257791f55acb" args="(CandidateSetIterator &amp;examples, CandidateSetIterator &amp;development_test)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classreranker_1_1_perceptron_model.html#a8ccab23af92f9a7db985257791f55acb">reranker::PerceptronModel::Train</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classreranker_1_1_candidate_set_iterator.html">CandidateSetIterator</a> &amp;&#160;</td>
          <td class="paramname"><em>examples</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classreranker_1_1_candidate_set_iterator.html">CandidateSetIterator</a> &amp;&#160;</td>
          <td class="paramname"><em>development_test</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Trains this model on a collection of training examples, where each training example is a set of candidates. </p>
<dl class="attention"><dt><b>Attention:</b></dt><dd>This method is implemented in terms of the <a class="el" href="classreranker_1_1_perceptron_model.html#abfb9261016f61a8f660e699ccbdafa6a">TrainOnExample</a> method. Thus, for mistake-driven learning methods similar to the perceptron, one need only derive a class from this one and override <a class="el" href="classreranker_1_1_perceptron_model.html#abfb9261016f61a8f660e699ccbdafa6a">TrainOnExample</a>.</dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">examples</td><td>the set of training examples on which to train this model </td></tr>
    <tr><td class="paramname">development_test</td><td>the set of held-out examples to use to evaluate the model after each epoch </td></tr>
  </table>
  </dd>
</dl>

<p>Implements <a class="el" href="classreranker_1_1_model.html#a0468287cffc492868548bc5627942734">reranker::Model</a>.</p>

<p>Definition at line <a class="el" href="perceptron-model_8_c_source.html#l00088">88</a> of file <a class="el" href="perceptron-model_8_c_source.html">perceptron-model.C</a>.</p>

</div>
</div>
<a class="anchor" id="ae88557a6953807829c8d5fb760589487"></a><!-- doxytag: member="reranker::PerceptronModel::TrainOneEpoch" ref="ae88557a6953807829c8d5fb760589487" args="(CandidateSetIterator &amp;examples)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classreranker_1_1_perceptron_model.html#ae88557a6953807829c8d5fb760589487">reranker::PerceptronModel::TrainOneEpoch</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classreranker_1_1_candidate_set_iterator.html">CandidateSetIterator</a> &amp;&#160;</td>
          <td class="paramname"><em>examples</em></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Trains this model for one epoch, i.e., a single pass through the specified set of training examples. </p>
<p>Typically the Train method will be implemented in terms of this method.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">examples</td><td>the set of training examples on which to train this model </td></tr>
  </table>
  </dd>
</dl>

<p>Implements <a class="el" href="classreranker_1_1_model.html#a6aeac4515eae1f8b6d7adf665f05060f">reranker::Model</a>.</p>

<p>Definition at line <a class="el" href="perceptron-model_8_c_source.html#l00176">176</a> of file <a class="el" href="perceptron-model_8_c_source.html">perceptron-model.C</a>.</p>

</div>
</div>
<a class="anchor" id="abfb9261016f61a8f660e699ccbdafa6a"></a><!-- doxytag: member="reranker::PerceptronModel::TrainOnExample" ref="abfb9261016f61a8f660e699ccbdafa6a" args="(CandidateSet &amp;example)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classreranker_1_1_perceptron_model.html#abfb9261016f61a8f660e699ccbdafa6a">reranker::PerceptronModel::TrainOnExample</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classreranker_1_1_candidate_set.html">CandidateSet</a> &amp;&#160;</td>
          <td class="paramname"><em>example</em></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Trains this model on the specified training example. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">example</td><td>the example to train on </td></tr>
  </table>
  </dd>
</dl>

<p>Implements <a class="el" href="classreranker_1_1_model.html#ad6a7660247d0c0477d5c4f01591a942b">reranker::Model</a>.</p>

<p>Definition at line <a class="el" href="perceptron-model_8_c_source.html#l00203">203</a> of file <a class="el" href="perceptron-model_8_c_source.html">perceptron-model.C</a>.</p>

</div>
</div>
<a class="anchor" id="ae7e3982866cc3db145c0e3ff4b6ef783"></a><!-- doxytag: member="reranker::PerceptronModel::Update" ref="ae7e3982866cc3db145c0e3ff4b6ef783" args="(CandidateSet &amp;example)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classreranker_1_1_perceptron_model.html#ae7e3982866cc3db145c0e3ff4b6ef783">reranker::PerceptronModel::Update</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classreranker_1_1_candidate_set.html">CandidateSet</a> &amp;&#160;</td>
          <td class="paramname"><em>example</em></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Updates the current model based on the specified set of candidates. </p>
<p><a class="el" href="classreranker_1_1_perceptron_model.html#abfb9261016f61a8f660e699ccbdafa6a">TrainOnExample</a> will be implemented in terms of this method.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">example</td><td>the current training example </td></tr>
  </table>
  </dd>
</dl>

<p>Implements <a class="el" href="classreranker_1_1_model.html#aef926c377e32ce215bbc69847853e16e">reranker::Model</a>.</p>

<p>Definition at line <a class="el" href="perceptron-model_8_c_source.html#l00237">237</a> of file <a class="el" href="perceptron-model_8_c_source.html">perceptron-model.C</a>.</p>

</div>
</div>
<hr/><h2>Friends And Related Function Documentation</h2>
<a class="anchor" id="af5282652b1f0ee34453543af00f8cee1"></a><!-- doxytag: member="reranker::PerceptronModel::PerceptronModelProtoReader" ref="af5282652b1f0ee34453543af00f8cee1" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">friend class <a class="el" href="classreranker_1_1_perceptron_model_proto_reader.html">PerceptronModelProtoReader</a><code> [friend]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="perceptron-model_8_h_source.html#l00066">66</a> of file <a class="el" href="perceptron-model_8_h_source.html">perceptron-model.H</a>.</p>

</div>
</div>
<a class="anchor" id="afb6ec9e4be1c64e078cadea26f2a3b8b"></a><!-- doxytag: member="reranker::PerceptronModel::PerceptronModelProtoWriter" ref="afb6ec9e4be1c64e078cadea26f2a3b8b" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">friend class <a class="el" href="classreranker_1_1_perceptron_model_proto_writer.html">PerceptronModelProtoWriter</a><code> [friend]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="perceptron-model_8_h_source.html#l00065">65</a> of file <a class="el" href="perceptron-model_8_h_source.html">perceptron-model.H</a>.</p>

</div>
</div>
<hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="acc08b37db0b4b7ea4cd8d340a4e86216"></a><!-- doxytag: member="reranker::PerceptronModel::best_model_epoch_" ref="acc08b37db0b4b7ea4cd8d340a4e86216" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="classreranker_1_1_perceptron_model.html#acc08b37db0b4b7ea4cd8d340a4e86216">reranker::PerceptronModel::best_model_epoch_</a><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>The epoch of the best models seen so far during training. </p>

<p>Definition at line <a class="el" href="perceptron-model_8_h_source.html#l00413">413</a> of file <a class="el" href="perceptron-model_8_h_source.html">perceptron-model.H</a>.</p>

</div>
</div>
<a class="anchor" id="a234283287d5a7f59fd8a1d1cf767fbc1"></a><!-- doxytag: member="reranker::PerceptronModel::best_models_" ref="a234283287d5a7f59fd8a1d1cf767fbc1" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classreranker_1_1_training_vector_set.html">TrainingVectorSet</a> <a class="el" href="classreranker_1_1_perceptron_model.html#a234283287d5a7f59fd8a1d1cf767fbc1">reranker::PerceptronModel::best_models_</a><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>The best models seen so far during training, according to evaluation on the held-out development test data. </p>

<p>Definition at line <a class="el" href="perceptron-model_8_h_source.html#l00411">411</a> of file <a class="el" href="perceptron-model_8_h_source.html">perceptron-model.H</a>.</p>

</div>
</div>
<a class="anchor" id="ad2d89585eec1b54986043d6f29a516c3"></a><!-- doxytag: member="reranker::PerceptronModel::max_epochs_in_decline_" ref="ad2d89585eec1b54986043d6f29a516c3" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="classreranker_1_1_perceptron_model.html#ad2d89585eec1b54986043d6f29a516c3">reranker::PerceptronModel::max_epochs_in_decline_</a><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>The maximum number of training epochs to keep training after the model starts to degrade (i.e., has more errors than the best model so far). </p>

<p>Definition at line <a class="el" href="perceptron-model_8_h_source.html#l00416">416</a> of file <a class="el" href="perceptron-model_8_h_source.html">perceptron-model.H</a>.</p>

</div>
</div>
<a class="anchor" id="ae18957d720914dd4bd4528f3de5b282d"></a><!-- doxytag: member="reranker::PerceptronModel::model_spec_" ref="ae18957d720914dd4bd4528f3de5b282d" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">string <a class="el" href="classreranker_1_1_perceptron_model.html#ae18957d720914dd4bd4528f3de5b282d">reranker::PerceptronModel::model_spec_</a><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="perceptron-model_8_h_source.html#l00423">423</a> of file <a class="el" href="perceptron-model_8_h_source.html">perceptron-model.H</a>.</p>

</div>
</div>
<a class="anchor" id="a6f913688d02fe624d91d1416c71e157c"></a><!-- doxytag: member="reranker::PerceptronModel::models_" ref="a6f913688d02fe624d91d1416c71e157c" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classreranker_1_1_training_vector_set.html">TrainingVectorSet</a> <a class="el" href="classreranker_1_1_perceptron_model.html#a6f913688d02fe624d91d1416c71e157c">reranker::PerceptronModel::models_</a><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>The feature vectors representing this model. </p>

<p>Definition at line <a class="el" href="perceptron-model_8_h_source.html#l00408">408</a> of file <a class="el" href="perceptron-model_8_h_source.html">perceptron-model.H</a>.</p>

</div>
</div>
<a class="anchor" id="a0c25e67c7e7e5cef36bbc1b1fb1cd111"></a><!-- doxytag: member="reranker::PerceptronModel::num_epochs_in_decline_" ref="a0c25e67c7e7e5cef36bbc1b1fb1cd111" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="classreranker_1_1_perceptron_model.html#a0c25e67c7e7e5cef36bbc1b1fb1cd111">reranker::PerceptronModel::num_epochs_in_decline_</a><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>The current number of training epochs in which the model has been degrading in development set performance (i.e., has been having more errors than best model so far). </p>

<p>Definition at line <a class="el" href="perceptron-model_8_h_source.html#l00420">420</a> of file <a class="el" href="perceptron-model_8_h_source.html">perceptron-model.H</a>.</p>

</div>
</div>
<a class="anchor" id="a78beef8fe9344050187f176230f52a0b"></a><!-- doxytag: member="reranker::PerceptronModel::proto_reader_spec_" ref="a78beef8fe9344050187f176230f52a0b" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">string <a class="el" href="classreranker_1_1_perceptron_model.html#a78beef8fe9344050187f176230f52a0b">reranker::PerceptronModel::proto_reader_spec_</a><code> [static, protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>A string that specifies to construct a <a class="el" href="classreranker_1_1_perceptron_model_proto_reader.html">PerceptronModelProtoReader</a>, which is capable of de-serializing an instance of this class. </p>

<p>Definition at line <a class="el" href="perceptron-model_8_h_source.html#l00428">428</a> of file <a class="el" href="perceptron-model_8_h_source.html">perceptron-model.H</a>.</p>

</div>
</div>
<a class="anchor" id="a2fcf5e3e8dbb2c0f731509d1af9230c0"></a><!-- doxytag: member="reranker::PerceptronModel::proto_writer_spec_" ref="a2fcf5e3e8dbb2c0f731509d1af9230c0" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">string <a class="el" href="classreranker_1_1_perceptron_model.html#a2fcf5e3e8dbb2c0f731509d1af9230c0">reranker::PerceptronModel::proto_writer_spec_</a><code> [static, protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>A string that specifies to construct a <a class="el" href="classreranker_1_1_perceptron_model_proto_writer.html">PerceptronModelProtoWriter</a>, which is capable of serializing an instance of this class. </p>

<p>Definition at line <a class="el" href="perceptron-model_8_h_source.html#l00432">432</a> of file <a class="el" href="perceptron-model_8_h_source.html">perceptron-model.H</a>.</p>

</div>
</div>
<a class="anchor" id="af852ec770ce5135acbf6f5db34b9d4fc"></a><!-- doxytag: member="reranker::PerceptronModel::step_size_" ref="af852ec770ce5135acbf6f5db34b9d4fc" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double <a class="el" href="classreranker_1_1_perceptron_model.html#af852ec770ce5135acbf6f5db34b9d4fc">reranker::PerceptronModel::step_size_</a><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>The last value computed by the ComputeStepSize method. </p>

<p>Definition at line <a class="el" href="perceptron-model_8_h_source.html#l00422">422</a> of file <a class="el" href="perceptron-model_8_h_source.html">perceptron-model.H</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="perceptron-model_8_h_source.html">perceptron-model.H</a></li>
<li><a class="el" href="perceptron-model_8_c_source.html">perceptron-model.C</a></li>
</ul>
</div><!-- contents -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Tue Apr 9 2013 11:56:32 for Reranker Framework (ReFr) by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>
